/**
 * Created by Administrator on 2017/2/21.
 */
(function (app) {
    app.controller("skillsController", skills);
    function skills($scope, $rootScope) {

        $rootScope.title = 'Skills';


        // 指定图表的配置项和数据
        $scope.option = {
            option: {
                backgroundColor: '#2c343c',

                title: {
                    text: '个人技能',
                    left: 'center',
                    top: 20,
                    textStyle: {
                        color: '#ccc',
                        fontStyle: 'normal',
                        fontWeight: 'normal'
                    }
                },

                tooltip: {
                    trigger: 'item',
                    formatter: "{a} <br/>{b} : {c} ({d}%)"
                },

                visualMap: {
                    show: false,
                    min: 80,
                    max: 600,
                    inRange: {
                        colorLightness: [0, 1]
                    }
                },
                series: [
                    {
                        name: '个人技能',
                        type: 'pie',
                        radius: '65%',
                        center: ['50%', '70%'],
                        data: [
                            {value: 335, name: 'jquery'},
                            {value: 310, name: 'html5+css3'},
                            {value: 274, name: 'bootstrp'},
                            {value: 235, name: 'angular'},
                            {value: 400, name: 'react'}
                        ].sort(function (a, b) {
                            return a.value - b.value
                        }),
                        roseType: 'angle',
                        label: {
                            normal: {
                                textStyle: {
                                    color: 'rgba(255, 255, 255, 0.3)'
                                }
                            }
                        },
                        labelLine: {
                            normal: {
                                lineStyle: {
                                    color: 'rgba(255, 255, 255, 0.3)'
                                },
                                smooth: 0.2,
                                length: 10,
                                length2: 20
                            }
                        },
                        itemStyle: {
                            normal: {
                                color: '#c23531',
                                shadowBlur: 200,
                                shadowColor: 'rgba(0, 0, 0, 0.1)'
                            }
                        },

                        animationType: 'scale',
                        animationEasing: 'elasticOut',
                        animationDelay: function (idx) {
                            return Math.random() * 200;
                        }
                    }
                ]
            }
        };

    }

})(angular.module(APP_NAME));